package com.example.s01_helloworld.controler;

import com.example.s01_helloworld.model.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController

public class UserControler {
    @RequestMapping(name="/getUser", method= RequestMethod.POST)
        public User getUser() {
        User user = new User();
        user.setName("小明");
        user.setAge(12);
        user.setPass("123456");
        return user;
    }

    @RequestMapping(value="/getUser2")
    public User getUser2(String username,int age,String password) {
        User user=new User();
        user.setName(username);
        user.setAge(age);
        user.setPass(password);
        return user;
    }


    @RequestMapping(value="/getUser3")
    public User getUser3(User user)
    {
        return user;
    }
}


